﻿using System;
using System.Net;
using System.Collections.ObjectModel;
using System.Collections.Generic;

namespace Airport
{
    public class Route
    {

        private int _routeId;
        private List<RouteNode> _routeNodes;
        private List<Taxiway> _taxiways;
        private List<Runway> _runways;

        /// <summary>
        /// Empty <c>Route</c> constructor.
        /// </summary>
        public Route()
            : this(-1)
        {
        }

        /// <summary>
        /// Creates a new <c>Route</c> with the given ID.
        /// </summary>
        /// <param name="inRouteId">int representing the explicit route ID for this <c>Route</c>.</param>
        public Route(int inRouteId)
        {
            _routeId = inRouteId;
            _routeNodes = new List<RouteNode>();
            _taxiways = new List<Taxiway>();
            _runways = new List<Runway>();
        }

        public Route(Flight flight)
        {
            //this.routeNodes = getShortestPath(flight.start, flight.end);
        }

        public int routeId
        {
            get
            {
                return _routeId;
            }

            set
            {
                if (_routeId != value)
                {
                    _routeId = value;
                }
            }
        }

        public List<RouteNode> routeNodes
        {
            get
            {
                return _routeNodes;
            }

            set
            {
                if (_routeNodes != value)
                {
                    _routeNodes = value;
                }
            }
        }
 
        public List<Taxiway> taxiways
        {
            get
            {
                return _taxiways;
            }

            set
            {
                if (_taxiways != value)
                {
                    _taxiways = value;
                }
            }
        }

        public List<Runway> runways
        {
            get
            {
                return _runways;
            }

            set
            {
                if (_runways != value)
                {
                    _runways = value;
                }
            }
        }

        public void setTimes()
        {
        }
    }

    public class RouteNode : Node
    {

        private DateTime _predictedTOA;
        private DateTime _actualTOA;
        private DateTime _expireTime;

        public DateTime predictedTOA
        {
            get
            {
                return _predictedTOA;
            }

            set
            {
                if (_predictedTOA != value)
                {
                    _predictedTOA = value;
                }
            }
        }

        public DateTime actualTOA
        {
            get
            {
                return _actualTOA;
            }

            set
            {
                if (_actualTOA != value)
                {
                    _actualTOA = value;
                }
            }
        }
 
        public DateTime expireTime
        {
            get
            {
                return _expireTime;
            }

            set
            {
                if (_expireTime != value)
                {
                    _expireTime = value;
                }
            }
        }
    }
}
